<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->string('name',20)->comment('用户名')->unique();
            $table->char('password',64)->comment('密码');
            $table->tinyInteger('type')->comment('管理员类型,总后台为0,机构为1');
            $table->integer('group_id')->comment('所属机构ID');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('admin');
    }
}
